package rsj.sql.finance;

import com.rlyy.aibase.utils.base.MapNode;
import com.rlyy.aibase.utils.base.Node;
import com.rlyy.aibase.utils.base.TableNode;
import rsj.annotation.DynamicSelect;
import rsj.annotation.Param;
import rsj.annotation.Select;
import rsj.annotation.Update;
import rsj.api.contract.entity.Contract;
import rsj.service.account.dynamic.FinanceDynamicStatement;

/**
 * 财务
 *
 * @author yuanqinglong
 * @since 2021/7/19 16:58
 */
public interface FinanceDao {


    /**
     * 财务列表
     *
     * @param autKey    账号标识
     * @param custSname 客户简称
     * @param custId    客户编号
     * @param pageSize  页面大小
     * @param pageNow   页面现在
     * @return {@link TableNode}
     */
    @DynamicSelect(type = FinanceDynamicStatement.class, method = "financeDynamicList")
    TableNode financeList(@Param("autKey") String autKey, @Param("custSname") String custSname, @Param("custId") String custId,
                          @Param("pageSize") Integer pageSize, @Param("pageNow") Integer pageNow);


    /**
     * 财务统计
     *
     * @param autKey    账号标识
     * @param custSname 客户简称
     * @param custId    客户编号
     * @return {@link Node}
     */
    @DynamicSelect(type = FinanceDynamicStatement.class, method = "financeDynamicCount")
    Node financeCount(@Param("autKey") String autKey, @Param("custSname") String custSname, @Param("custId") String custId);


    /**
     * 添加合同
     *
     * @param contract 合同
     */
    @Update(value = "INSERT INTO sys.sys_orgp ")
    void addContract(Contract contract);


    /**
     * 合同的细节
     *
     * @param orgId org id
     * @return {@link MapNode}
     */
    @Select(value = "SELECT ")
    MapNode contractDetail(@Param("orgId") String orgId);
}
